<template>
  <el-popover placement="right-start" :width="popoverWidth" trigger="hover">
    <div>
      <div>{{ dictionary.title }}</div>
      <div v-for="item in dictionary.content" :key="item">
        {{ item }}
      </div>
    </div>

    <template slot="reference">
      <commonIcon
        class="el-icon-question"
        isStyle
        style="margin-left: 10px"
        iconType="icon"
      ></commonIcon>
    </template>
  </el-popover>
</template>

<script>
import dictionary from "@/utils/dictionary";
import CommonIcon from "@/components/CommonIcon";
export default {
  components: {
    CommonIcon,
  },
  props: {
    tipType: {
      type: String,
      default: "",
    },
    popoverWidth: {
      type: String,
      default: '320'
    }
  },

  data() {
    return {
      dictionary: {},
    };
  },

  created() {
    this.dictionary = dictionary[this.tipType];
  },
};
</script>